/*
 * This file is part of quickReminder, a software for gamers
 *
 * Copyright (C) 2006-2008 Lucas Romero
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Specialized;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
using System.Collections;

namespace quickReminder
{
    [Serializable]
    class ConfigRules : CollectionBase
    {
    }
    [Serializable]
    class ConfigRuleCollection : CollectionBase
    {
        StringCollection m_MatchingLeagues = new StringCollection();
        public LegalityLevel CheckLegality(ConfigKeyValue value)
        {
            return LegalityLevel.Legal;
        }
    }
    [Serializable]
    class ConfigRule
    {
        public ConfigRule() { /* empty */ }
        public ConfigRule(string Name, double ForcedValue)
        {
            this.m_VarName = Name;
            this.m_MinVal = ForcedValue;
            this.m_MaxVal = ForcedValue;
        }
        public ConfigRule(string Name, double MinVal, double MaxVal)
        {
            this.m_VarName = Name;
            this.m_MinVal = MinVal;
            this.m_MaxVal = MaxVal;
        }
        LegalityLevel m_Legality;
        string m_Description;
        string m_VarName;
        double m_MinVal = double.MinValue;
        double m_MaxVal = double.MaxValue;
        bool m_IsForbidden = false;

        [XmlAttribute("legality")]
        public LegalityLevel Legality
        {
            get { return m_Legality; }
            set { m_Legality = value; }
        }
        [XmlAttribute("forbidden")]
        public bool IsForbidden
        {
            get { return m_IsForbidden; }
            set { m_IsForbidden = value; }
        }
        [XmlAttribute("cvar")]
        public string VarName
        {
            get { return m_VarName; }
            set { m_VarName = value; }
        }
        [XmlAttribute("desc")]
        public string Description
        {
            get { return m_Description; }
            set { m_Description = value; }
        }
        [XmlAttribute("min")]
        public double MinVal
        {
            get { return m_MinVal; }
            set { m_MinVal = value; }
        }
        [XmlAttribute("max")]
        public double MaxVal
        {
            get { return m_MaxVal; }
            set { m_MaxVal = value; }
        }
    }
}
